package com.example.controller;

import com.example.entity.Article;
import com.example.entity.Comment;
import com.example.service.ArticleService;
import com.example.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TestController {

    @GetMapping("/hello")
    public String hello(){
        int i = 1/0;
        return "hello";
    }

    @PostMapping("/hello2")
    public String hello2(){
        return "hello2";
    }

    @Autowired
    private CommentService commentService;

    @GetMapping("/selectComment")
    public List<Comment> comment(){
        return commentService.selectCommentAll();
    }






}
